package cn.hnevc.chengziyang;



public class Example50 {
	 public static void main(String[] args) {
			Dog dog=new Dog();//实例化Dog
			dog.name="二哈";//为Dog类中的name属性赋值
			dog.prinNme();//调用dog中的prinName()
			dog.shout();//调用dog类继承来的shout
		  }
		}


		// 定义Animal类
		class Animal {
			String name;

			void shout() {
				System.out.println("动物发出的叫声");
			
			}
		}
		//定义Dog类
		class Dog extends Animal{
			public void  prinNme(){
				System.out.println(name);
				
			}
		}


